<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box {
            width: 300px;
            height: 500px;
            border: 2px solid black;
            border-radius: 70px;
            background-color: rgb(238, 241, 250);
            flex-wrap: wrap;
            padding-top: 100px;
        }

        #ge {}
    </style>
</head>

<body>
    <div id="box">


        手机号：<input type="text" id="phone"><br>
        验证码：<input type="text" id="yanzheng"><button class="gettimer">获取验证码</button>
        <button class="login">登录</button>
    </div>

    <script src="./jquery-1.8.3.min.js"></script>


    <script>
        var i=60;
        $(".gettimer").click(() => {
            $.ajax({
                url: "http://43.143.211.183:8889/sendSms/"+$("#phone").val(),
                type: "get",
                success(){

                }
            })
            let b = setInterval(() => {
                i--;
                $(".gettimer").html(i);
                clearTimeout(b);
            }, 1000);
    
        })

        $(".login").click(() => {
            $.ajax({
                url: "http://43.143.211.183:8889/login/h5/with-phone-code",
                type: "post",
                data: JSON.stringify({
                    phone: $("#phone").val(),
                    phone_code: $("#yanzheng").val(),
                    invite_code: "",
                }),

                contentType: 'application/json',
                success(a) {
                    console.log(a);


                }

            })
        })


    </script>
</body>

</html>